package com.yang.frost.blueberry.service;

import com.yang.frost.blueberry.domain.SysUser;
import com.yang.frost.blueberry.params.BaseParam;
import com.yang.frost.blueberry.params.LoginParam;
import com.yang.frost.blueberry.shiro.vo.LoginSysUserTokenVo;
import com.yang.frost.blueberry.util.ApiResult;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @author 10296
 * @date 2021/1/25
 * @Description: 登录服务接口
 */
public interface LoginService {
    /**
     * 登录
     *
     * @param loginParam 参数
     * @return ""
     * @throws Exception e
     */
    ApiResult login(LoginParam loginParam) throws Exception;

    /**
     * 退出登录
     *
     * @param param
     * @throws Exception
     */
    void logout(BaseParam param) throws Exception;

    /**
     * 用户名
     *
     * @param userName username
     * @return ""
     * @throws Exception e
     */
    SysUser getSysUserByUserName(String userName) throws Exception;

    /**
     * 根据用户名和密码获取用户信息
     *
     * @param paramsMap ""
     * @return
     * @throws Exception
     */
    SysUser getSysUserByPassWord(Map<String, Object> paramsMap) throws Exception;

    /**
     * 检查验证码是否正确
     *
     * @param verifyToken 验证码
     * @param code        code
     * @throws Exception e
     */
    void checkVerifyCode(String verifyToken, String code) throws Exception;

    /**
     * 生成验证码
     *
     * @throws Exception e
     */
    void generateVerifyCode() throws Exception;

    /**
     * 验证Token
     *
     * @param token token
     * @return 对象
     */
    ApiResult verifyAuthToken(String token);
}
